package com.yanqu.road.entity.activity.luckyshop;

import com.yanqu.road.entity.activity.ActivityInfo;
import com.yanqu.road.entity.activity.luckyshop.config.LuckyShopDrawConfig;
import com.yanqu.road.entity.config.system.NormalWeightItem;
import com.yanqu.road.utils.property.Property;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class LuckyShopConfig {

    private ActivityInfo activityInfo;

    private Map<Integer, LuckyShopDrawConfig> drawConfigMap = new HashMap<>();

    private List<NormalWeightItem> weightItemList = new ArrayList<>();

    /**
     * 大奖
     */
    private List<Property> bigRewardList = new ArrayList<>();

    /**
     * 大奖次数
     */
    private int bigRewardTimes;

    public ActivityInfo getActivityInfo() {
        return activityInfo;
    }


    public int getActivityId() {
        return activityInfo.getActivityId();
    }

    public void setActivityInfo(ActivityInfo activityInfo) {
        this.activityInfo = activityInfo;
    }

    public Map<Integer, LuckyShopDrawConfig> getDrawConfigMap() {
        return drawConfigMap;
    }

    public void setDrawConfigMap(Map<Integer, LuckyShopDrawConfig> drawConfigMap) {
        this.drawConfigMap = drawConfigMap;

        List<NormalWeightItem> tmpList = new ArrayList<>();
        for (LuckyShopDrawConfig drawConfig : drawConfigMap.values()) {
            tmpList.add(new NormalWeightItem(BigInteger.valueOf(drawConfig.getId()), drawConfig.getWeight()));
        }
        this.weightItemList = tmpList;
    }

    public List<NormalWeightItem> getWeightItemList() {
        return weightItemList;
    }

    public LuckyShopDrawConfig getLuckyShopDrawConfig(int drawId) {
        return drawConfigMap.get(drawId);
    }

    public List<Property> getBigRewardList() {
        return bigRewardList;
    }

    public void setBigRewardList(List<Property> bigRewardList) {
        this.bigRewardList = bigRewardList;
    }

    public int getBigRewardTimes() {
        return bigRewardTimes;
    }

    public void setBigRewardTimes(int bigRewardTimes) {
        this.bigRewardTimes = bigRewardTimes;
    }
}
